<ion-view view-title="注册">
  <ion-content class="padding"  >
    <div class="card">
    <form name="form" novalidate>
        <label class="item item-input">
    <span class="input-label">用户名</span>
    <input type="text" name = "user" ng-model="user.username" ng-blur="username = true;" required>
  </label>
        <ion-item ng-show="form.user.$error.required && username"> <span class="assertive" >请输入用户名</span></ion-item>
        <label class="item item-input">
    <span class="input-label">邮箱</span>
    <input type="email" name="email" ng-model="user.email" ng-blur="email = true;" required >   
  </label>
        <ion-item ng-show="email && (form.email.$error.required || form.email.$error.email)"><span class="assertive" ng-show="form.email.$error.required">请输入邮箱</span><span class="assertive" ng-show="form.email.$error.email">邮箱地址非法</span></ion-item>
        <label class="item item-input">
    <span class="input-label">密码</span>
    <input type="password" name="password" ng-model="user.password" ng-blur="password = true;" required>
        </label>
        <ion-item ng-show="password && form.password.$error.required"><span class="assertive" >请输入密码</span>
        </ion-item>
        <label class="item item-input">
    <span class="input-label">支付账户</span>
    <input type="text" name="payname" ng-model="user.payname" ng-blur="payname = true;" required>
  </label>
        <ion-item ng-show="payname && form.payname.$error.required"><span class="assertive" >请输入支付账户</span></ion-item>
        <label class="item item-input">
    <span class="input-label">收货地址</span>
    <input type="text" name="address" ng-model="user.address" ng-blur="address = true;" required>

  </label>
        <ion-item ng-show="address && form.address.$error.required"><span class="assertive" >请输入收货地址</span></ion-item>
    </form>
    <io-item>
      <button ng-disabled="form.user.$pristine || form.password.$pristine || form.payname.$pristine || form.address.$pristine || form.email.$error.email" class="button button-balanced button-outline button-block" ng-click="sign_out()">注册</button>
    </io-item>

    </div>

  </ion-content>
</ion-view>